<template>
  <a-modal v-model:open="open" title="输入密码" @ok="handleOk">
    <a-form
        :model="form"
        style="margin: 20px 0"
        layout="inline"
        name="basic"
        autocomplete="off"
    >
      <a-form-item
          label="密码"
          name="password"
          :rules="[{ required: true, message: '请输入密码' }]"
      >
        <a-input-password v-model:value="form.password" />
      </a-form-item>
    </a-form>
  </a-modal>
</template>

<script lang="ts" setup>
const open = ref<boolean>(false)
const emits = defineEmits(['handleOk'])
const form = reactive({
  password:"",
})

const openModal = () => {
  form.password = ''
  open.value = true;
}
const closeModal = () => {
  open.value = false;
}
const handleOk = (e: MouseEvent) => {
  // console.log(e);
  open.value = false;
  emits('handleOk',form)
};

defineExpose({
  openModal
})
</script>

<style scoped>

</style>
